<%--
 * @description: 审批流程渲染 公共页面
 --%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<div class="layui-tab-item">
        <!-- start 审批数据显示  -->
        <div class="layui-form-item" style="padding-top:25px">
      	<label class="layui-form-label"  style="width:80px;"  style="width:80px;"></label>
      	<div class="layui-input-block" style="padding-bottom:15px">
			<c:set var="nodeIdx" value="0"/>
      		<c:forEach items="${sharedAllNodes}" var="procNode"  varStatus="s">
      			<c:if test="${(procNode.nodePolicy==1||procNode.nodePolicy==3)&&procNode.nodeIdx!=nodeIdx}">
					<c:set var="nodeIdx" value="${procNode.nodeIdx}"/>
	         		<a class="layui-btn
			      		<c:choose>
				      		<c:when test="${procNode.state=='-2'}">layui-btn-primary</c:when>
				      		<c:when test="${procNode.state=='-1'}">layui-btn-red</c:when>
				      	</c:choose>
		      		" >${procNode.nodeName}</a>
		      		<c:if test="${!s.last}">
			      		<i class="layui-icon layui-icon-right"></i>
		      		</c:if>
	      		</c:if>
         	</c:forEach>
      	</div>
      	<hr>
      	<!-- 审批时 显示的流程信息   -->
        <c:if test="${'y'==processDealWith}">
           <c:forEach items="${sharedAllNodes}" var="procNode"  varStatus="s">
           		<c:if test="${procNode.nodePolicy==1||procNode.nodePolicy==3}">
           		<c:if test="${procNode.state == '0' or procNode.state == '1'}">
				      		<div class="layui-form-item">
						      	<label class="layui-form-label"  style="width:80px;">节点</label>
						      	<div class="layui-input-inline">
						      		<input type="text" value="${procNode.nodeName}" readonly="readonly" style="border:0px" class="layui-input">
					            </div>
						      	<label class="layui-form-label"  style="width:80px;">审批人</label>
						      	<div class="layui-input-inline"  style="width:250px;">
								    <input type="text" value="${procNode.dealName}(${procNode.userOrgName}—${procNode.userDeptName})" title="${procNode.dealName}(${procNode.userOrgName}—${procNode.userDeptName})" readonly="readonly" style="border:0px" class="layui-input">
					            </div>
						      	<label class="layui-form-label"  style="width:80px;">审批时间</label>
						      	<div class="layui-input-inline">
								    <input type="text" value="<fmt:formatDate value="${procNode.dealTime }" pattern="yyyy-MM-dd HH:mm:ss"/>" readonly="readonly" style="border:0px" class="layui-input">
					      		</div>
					      	</div>
					      	<div class="layui-form-item">
					            <label class="layui-form-label"  style="width:80px;">审批结果</label>
						      	<div class="layui-input-inline">
						      		<input type="text" value=
						      		<c:choose>
							      		<c:when test="${procNode.state == '0'}">不同意</c:when>
							      		<c:when test="${procNode.state == '1'}">同意</c:when>
							      	</c:choose>
					      	 		  readonly="readonly" style="border:0px
					      	 		  <c:choose>
							      		<c:when test="${procNode.state == '0'}">;color:red;</c:when>
							      	  </c:choose>
					      	 		  " class="layui-input"></input>
					            </div>
						      	<label class="layui-form-label"  style="width:80px;">审批意见</label>
						      	<div class="layui-input-inline">
					            	<textarea readonly="readonly" class="layui-textarea" style="width:450px;height:35px;">${procNode.dealIdea}</textarea>
					            </div>
					      	</div>
					      	<div class="layui-form-item">
					            <c:if test="${not empty procNode.fileAtts }">
					            	<label class="layui-form-label"  style="width:80px;">相关附件</label>
						            <div class="layui-input-block">
								    	<div class="layui-upload">
					                		<div class="layui-upload-list">
						                		<c:forEach items="${procNode.fileAtts }" var="fileAtt">
						              				<div class="layui-upload-img-div">
						              					<c:choose>
							              					<c:when test="${fileAtt.fileSuffix == '.jpg' or fileAtt.fileSuffix == '.jpeg' or fileAtt.fileSuffix == '.png'}">
								              					<img src="${fileHttpPre }/${fileAtt.filePath }" title="${fileAtt.fileName}" class="layui-upload-img">
								              				</c:when>
								              				<c:otherwise>
								              					<img src="${ctx}/resources/images/${fn:substring(fileAtt.fileSuffix,1,5)}.jpg" title="${fileAtt.fileName}" class="layui-upload-img">
								              				</c:otherwise>
						              					</c:choose>
						              					<div class="mask">
						              						<a href="javascript:void(0)" style="margin-left:32px" onclick="showImg('${fileHttpPre}/${fileAtt.filePath }');">查看</a>
						              					</div>
						              					<p>${fileAtt.fileName}</p>
						              				</div>
							              		</c:forEach>
					                		</div>
							            </div>
								    </div>
							    </c:if>
					      	</div>
		      		<hr>
		      	</c:if>
		      	</c:if>
		</c:forEach>
		</c:if>
		<!-- 详情页时 显示的流程信息   -->
		<c:if test="${'y'!=processDealWith}">
		<c:forEach items="${sharedAllNodes}" var="procNode"  varStatus="s">
         		<c:if test="${procNode.state != '-2' && (procNode.nodePolicy==1||procNode.nodePolicy==3)}">
         				<c:choose>
		      		<c:when test="${procNode.state == '-1'}">
			      		<div class="layui-form-item">
				      	<label class="layui-form-label"  style="width:80px;">节点</label>
				      	<div class="layui-input-inline">
				      		<input type="text" value="${procNode.nodeName}" readonly="readonly" style="border:0px" class="layui-input">
			            </div>
				      	<label class="layui-form-label"  style="width:80px;">审批人</label>
				      	<div class="layui-input-inline" style="width:250px;">
					      	<input type="text" value="${procNode.dealName!=null?procNode.dealName:'--'}"   readonly="readonly" style="border:0px" class="layui-input">
			            </div>
				      	<label class="layui-form-label"  style="width:80px;">审批时间</label>
				      	<div class="layui-input-inline">
					      	<input type="text" value="--" readonly="readonly" style="border:0px" class="layui-input">
			      		</div>
			      	</div>
			      	<div class="layui-form-item">
			            <label class="layui-form-label"  style="width:80px;">审批结果</label>
				      	<div class="layui-input-inline">
				      		<input type="text" value='待审批' readonly="readonly" style="border:0px;color:red;" class="layui-input"></input>
			            </div>
				      	<label class="layui-form-label"  style="width:80px;">审批意见</label>
				      	<div class="layui-input-inline">
			            	<textarea readonly="readonly" class="layui-textarea" style="width:450px;height:35px;">--</textarea>
			            </div>
			      	</div>
		      	</c:when>
		      	<c:otherwise>
		      		<div class="layui-form-item">
				      	<label class="layui-form-label"  style="width:80px;">节点</label>
				      	<div class="layui-input-inline">
				      		<input type="text" value="${procNode.nodeName}" readonly="readonly" style="border:0px" class="layui-input">
			            </div>
				      	<label class="layui-form-label"  style="width:80px;"  style="width:80px;">审批人</label>
				      	<div class="layui-input-inline" style="width:250px;">
						    <input type="text" value="${procNode.dealName}(${procNode.userOrgName}—${procNode.userDeptName})" title="${procNode.dealName}(${procNode.userOrgName}—${procNode.userDeptName})" readonly="readonly" style="border:0px" class="layui-input">
			            </div>
				      	<label class="layui-form-label"  style="width:80px;"  style="width:80px;">审批时间</label>
				      	<div class="layui-input-inline">
						    <input type="text" value="<fmt:formatDate value="${procNode.dealTime }" pattern="yyyy-MM-dd HH:mm:ss"/>" readonly="readonly" style="border:0px" class="layui-input">
			      		</div>
			      	</div>
			      	<div class="layui-form-item">
			            <label class="layui-form-label"  style="width:80px;"  style="width:80px;">审批结果</label>
				      	<div class="layui-input-inline">
				      		<input type="text" value=
				      		<c:choose>
					      		<c:when test="${procNode.state == '0'}">不同意</c:when>
					      		<c:when test="${procNode.state == '1'}">同意</c:when>
					      	</c:choose>
			      	 		  readonly="readonly" style="border:0px
			      	 		  <c:choose>
					      		<c:when test="${procNode.state == '0'}">;color:red;</c:when>
					      	  </c:choose>
			      	 		  " class="layui-input"></input>
			            </div>
				      	<label class="layui-form-label"  style="width:80px;"  style="width:80px;">审批意见</label>
				      	<div class="layui-input-inline">
			            	<textarea readonly="readonly" class="layui-textarea" style="width:450px;height:35px;">${procNode.dealIdea}</textarea>
			            </div>
			      	</div>
			      	<div class="layui-form-item">
			            <c:if test="${not empty procNode.fileAtts }">
				            <label class="layui-form-label"  style="width:80px;"  style="width:80px;">相关附件</label>
				            <div class="layui-input-block">
						    	<div class="layui-upload">
			                		<div class="layui-upload-list">
				                		<c:forEach items="${procNode.fileAtts }" var="fileAtt">
				              				<div class="layui-upload-img-div">
				              					<c:choose>
					              					<c:when test="${fileAtt.fileSuffix == '.jpg' or fileAtt.fileSuffix == '.jpeg' or fileAtt.fileSuffix == '.png'}">
						              					<img src="${fileHttpPre }/${fileAtt.filePath }" title="${fileAtt.fileName}" class="layui-upload-img">
						              				</c:when>
						              				<c:otherwise>
						              					<img src="${ctx}/resources/images/${fn:substring(fileAtt.fileSuffix,1,5)}.jpg" title="${fileAtt.fileName}" class="layui-upload-img">
						              				</c:otherwise>
				              					</c:choose>
				              					<div class="mask">
				              						<a href="javascript:void(0)" style="margin-left:32px" onclick="showImg('${fileHttpPre}/${fileAtt.filePath }');">查看</a>
				              					</div>
				              					<p>${fileAtt.fileName}</p>
				              				</div>
					              		</c:forEach>
			                		</div>
					            </div>
						    </div>
					    </c:if>
			      	</div>
		      	</c:otherwise>
		      	</c:choose>
      	<hr>
      	</c:if>
		</c:forEach>
      	</c:if>
	</div>
<!-- end 审批数据显示  -->
</div>
